package android.com.br.braziltvguide;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;

public class ImageAdapter extends BaseAdapter {
	
	public static LayoutInflater layIn = null;
	
	private Context mContext;
	
    public ImageAdapter(Context c) {
        mContext = c;
    }
    
    public int getCount() {
        return mThumbIds.length;
    }

    public Object getItem(int position) {
        return null;
    }

    public long getItemId(int position) {
        return 0;
    }
    
    // create a new ImageView for each item referenced by the Adapter
    public View getView(int position, View convertView, ViewGroup parent) {
        
    	View MyView = convertView;

        if ( convertView == null )
        {
                               /*we define the view that will display on the grid*/
           
           //Inflate the layout
           LayoutInflater li = layIn;
           MyView = li.inflate(R.layout.main, null);
           
/*           // Add The Text!!!
           TextView tv = (TextView)MyView.findViewById(R.id.txtTexto);
           tv.setText("Item "+ position );
           
           // Add The Image!!!           
           ImageView iv = (ImageView)MyView.findViewById(R.id.grid_item_image);
           iv.setImageResource(R.drawable.icon);*/
        }    	
    	
    	return MyView;
    	
    }

    // references to our images
    private Integer[] mThumbIds = {
            R.drawable.tv, R.drawable.tv,
            R.drawable.tv, R.drawable.tv
    };    
}
